package com.power.project.model.vo;

import com.power.common.file.model.FileMeta;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author mrzhao
 * @CreateDate 2024/7/3 11:47
 * @Desc TODO
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FileVO extends FileMeta {
    /**
     * 文（附）件id
     */
    private Integer attachmentId;

    public FileVO(FileMeta fileMeta) {
        setFilename(fileMeta.getFilename());
        setFiletype(fileMeta.getFiletype());
        setPath(fileMeta.getPath());
        setUrl(fileMeta.getUrl());
        setSize(fileMeta.getSize());
    }

    public FileVO(Integer attachmentId, String name, String url) {
        this.attachmentId = attachmentId;
        setFilename(name);
        setUrl(url);
    }
}
